/**
 * <p>
 * Created on 2006-07-24 9:20:14 <br>
 * Copyright (c) 2006, All rights reserved.
 * </p>
 * @author Widen
 */
package com.widen.prima.util.test;

/**
 * This is a program which can read information from a Web server.
 * 
 * @version 1.0 2000/01/01
 * @author jdeveloper
 */
import java.net.*;
import java.io.*;

public class GetHTML
{
    public static String urlString = "http://localhost:8080/birt-viewer/run?__report=report/income_statement.rptdesign&queryTime=20051031235959999";

    public static void main(String args[])
    {
        // if (args.length < 1)
        // {
        // System.out.println("USAGE: java GetHTML httpaddress");
        // System.exit(1);
        // }
        // String sURLAddress = new String(args[0]);
        URL url = null;
        try
        {
            url = new URL(urlString);
        } catch (MalformedURLException e)
        {
            System.err.println(e.toString());
            System.exit(1);
        }
        try
        {
            InputStream ins = url.openStream();
            BufferedReader breader = new BufferedReader(new InputStreamReader(
                ins));
            String info = breader.readLine();
            while (info != null)
            {
                System.out.println(info);
                info = breader.readLine();
            }
        } catch (IOException e)
        {
            System.err.println(e.toString());
            System.exit(1);
        }
    }
}